import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:kepu/util/http_util.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../../model/plant_list_by_type_entity.dart';

part 'plant_list_by_type_provider.g.dart';

@riverpod
Future<PlantListByTypeEntity> plantListByType(Ref ref,{required int id}) async {
  var response = await DioInstance.instance().get(path: "type/sort_plant?id=$id");

  return PlantListByTypeEntity.fromJson(response.data);
}
